package com.tcat.search.web;

import com.tcat.common.vo.PageResult;
import com.tcat.item.pojo.Brand;
import com.tcat.item.pojo.SpecParam;
import com.tcat.search.client.BrandClient;
import com.tcat.search.client.SpecificationClient;
import com.tcat.search.pojo.Goods;
import com.tcat.search.pojo.SearchRequest;
import com.tcat.search.service.SearchService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@Api(tags = "规格参数管理")
@RestController
public class searchController {
    @Autowired
    private SearchService searchService;


    @Autowired
    private BrandClient brandClient;
    /**
     * 搜索功能
     * @param searchRequest
     * @return
     */
    @PostMapping("page")
    public ResponseEntity<PageResult<Goods>> search(@RequestBody SearchRequest searchRequest){
        return ResponseEntity.ok(searchService.search(searchRequest));
    }



}
